﻿@model N03_11HCA_HTTTHD.Models.Kho_ThemTimMua
@using N03_11HCA_HTTTHD.Models

@{
    ViewBag.Title = "Thêm tìm mua";
    Layout = "~/Views/Shared/_LayoutKho.cshtml";
}

@section JavaScriptCSSImport{
    <link href="@Url.Content("~/Content/mycontent/list_counter.css")" rel="stylesheet" type="text/css"/>
     <script type="text/javascript">
         function validateForm() {
             var tentv = document.forms["TimMua"]["@Kho_ThemTimMua.Name_tenViet"].value;
             var tenanh = document.forms["TimMua"]["@Kho_ThemTimMua.Name_tenAnh"].value;
             var mota = document.forms["TimMua"]["@Kho_ThemTimMua.Name_moTa"].value;
             var tukhoa = document.forms["TimMua"]["@Kho_ThemTimMua.Name_tuKhoa"].value;
             var namsanxuat = document.forms["TimMua"]["@Kho_ThemTimMua.Name_namSanXuat"].value;

             if(isNaN(namsanxuat.toString)==true)
             {
                alert("Năm sản xuất là một số");
                 return false;
             }
             if (tukhoa == null || tukhoa == "") {
                 alert("Vui lòng nhập từ khóa");
                 return false;
             }
             if (mota == null || mota == "") {
                 alert("Vui lòng nhập mô tả");
                 return false;
             }

             if (tentv == null || tentv == "") {
                 alert("Vui lòng nhập tên tiếng việt");
                 return false;
             }
             if (tenanh == null || tenanh == "") {
                 alert("Vui lòng nhập tên tiếng anh");
                 return false;
             }
             return true;
         }
    </script>
}
 
 <h2>Thêm tìm mua</h2>
<form name="TimMua" method="post" action="/Kho/ThemTimMua" onsubmit="return validateForm()">

<table border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td colspan="2">
                <span>THÔNG TIN CHUNG</span>
            </td>
        </tr>
        <tr>
            <td>
                <span>Loại tìm mua: </span>
            </td>
            <td>
               <select name="loaiTimMua">
                    <option value="1">Thiết bị</option>
                    <option value="1">Dịch vụ</option>
                    <option value="">Phần mềm</option>                    
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <span>Tên tiếng Việt: </span>
            </td>
            <td>
                <input type="text" name="@Kho_ThemTimMua.Name_tenViet" />
            </td>
        </tr>
        <tr>
            <td>
                <span>Tên tiếng Anh: </span>
            </td>
            <td>
                <input type="text" name="@Kho_ThemTimMua.Name_tenAnh" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <span>Mô tả:</span>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <textarea rows="5" cols="90" name="@Kho_ThemTimMua.Name_moTa"></textarea>
            </td>
        </tr>
        <tr>
            <td>
                <span>Đạt tiêu chuẩn: </span>
            </td>
            <td colspan="2">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tbody>
                    @for (int i = 0; i < Model.ListTieuChuan.Count; i++)
                    {
                        String id = @Kho_ThemTimMua.Name_tieuChuan +@Model.ListTieuChuan[i].ID;
                        <tr>
                            <td>
                           <input type ="checkbox"  name="@Kho_ThemTimMua.Name_tieuChuan"value="@Model.ListTieuChuan[i].ID" id="@id"/> 
                                <label for="@id"> @Model.ListTieuChuan[i].Ten</label>
                               
	                            
                                              
                            </td>
                        </tr>
                    }
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <span>Chuyển giao: </span>
            </td>
            <td colspan="2">
                <table border="0" cellpadding="0" cellspacing="0">
              
                    <tbody>
                      @for (int i = 0; i < Model.ListChuyenGiao.Count; i++)
                {
                    String id = "idChuyenGiao" +@Model.ListChuyenGiao[i].ID;
                      <tr>
                            <td>
                              <input type ="checkbox" name="@Kho_ThemTimMua.Name_chuyenGiao" value="@Model.ListChuyenGiao[i].ID" id="@id"/> 
                               <label for="@id"> @Model.ListChuyenGiao[i].Ten</label>
                              
                            </td>
                        </tr>
                }
                      
                       
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <span>Năm sản xuất: </span>
            </td>
            <td>
                <input type="text" name="@Kho_ThemTimMua.Name_namSanXuat" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <span>Thông tin khác: </span>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <textarea cols="90" rows="4" name="@Kho_ThemTimMua.Name_thongTinKhac"></textarea>
            </td>
        </tr>
    </tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td colspan="2">
                <span>THÔNG TIN PHÂN LOẠI</span>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <span>Thuộc lĩnh vực: </span>
            </td>           
        </tr>
       
        <tr>
              <td  colspan="2">
               <table border="0" cellpadding="0" cellspacing="0">
                    <tbody>
                    @for (int i = 0; i < Model.ListPhanLoai.Count; i++)
                    {
                        String id = "idPhanLoai" +@Model.ListPhanLoai[i].ID;
                        <tr>
                            <td>
                             <input type ="checkbox" value="@Model.ListPhanLoai[i].ID" name="@Kho_ThemTimMua.Name_linhVuc" id="@id"/> 
                                <label for="@id"> @Model.ListPhanLoai[i].TenDanhMuc</label>
                               
                            </td>
                        </tr>
                    }
                       
                        
                    </tbody>
                </table>
            </td>
        </tr>
          <tr>
         <td>
               <span>
                    Từ khóa:
                </span>
         </td>
         <td>
                <input type="text" name="@Kho_ThemTimMua.Name_tuKhoa" />
            </td>

        </tr>

          <tr>
         <tr>
            <td>
                <span>Xuất xứ: </span>
            </td>
            <td>
                <select name="@Kho_ThemTimMua.Name_xuatXu" >
				    <option value="Albania">Albania</option>
				    <option value="Algeria">Algeria</option>
				    <option value="American Samoa">American Samoa</option>
				    <option value="Antarctica">Antarctica</option>
				    <option value="Angola">Angola</option>
				    <option value="Anguilla">Anguilla</option>
				    <option value="APCTT">APCTT</option>
				    <option value="Argentina">Argentina</option>
				    <option value="Armenia">Armenia</option>
				    <option value="Aruba">Aruba</option>
				    <option value="Australia">Australia</option>
				    <option value="Austria">Austria</option>
				    <option value="Azerbaijan">Azerbaijan</option>
				    <option value="Bahamas">Bahamas</option>
				    <option value="Bahrain">Bahrain</option>
				    <option value="Bangladesh">Bangladesh</option>
				    <option value="Barbados">Barbados</option>
				    <option value="Belarus">Belarus</option>
				    <option value="Belgium">Belgium</option>
				    <option value="Belize">Belize</option>
				    <option value="Benin">Benin</option>
				    <option value="Bermuda">Bermuda</option>
				    <option value="Bhutan">Bhutan</option>
				    <option value="Bolivia">Bolivia</option>
				    <option value="Botswana">Botswana</option>
				    <option value="Bouvet Island">Bouvet Island</option>
				    <option value="Brazil">Brazil</option>
				    <option value="Brunei">Brunei</option>
				    <option value="Bulgaria">Bulgaria</option>
				    <option value="Burkina Faso">Burkina Faso</option>
				    <option value="Burundi">Burundi</option>
				    <option value="Cambodia">Cambodia</option>
				    <option value="Cameroon">Cameroon</option>
				    <option value="Canada">Canada</option>
				    <option value="Cape Verde">Cape Verde</option>
				    <option value="Cayman Islands">Cayman Islands</option>
				    <option value="Comoros">Comoros</option>
				    <option value="Congo">Congo</option>
				    <option value="Congo">Congo</option>
				    <option value="Cook Islands">Cook Islands</option>
				    <option value="Costa Rica">Costa Rica</option>
				    <option value="Cuba">Cuba</option>
				    <option value="Cyprus">Cyprus</option>
				    <option value="Czech Republic">Czech Republic</option>
				    <option value="Chad">Chad</option>
				    <option value="Chile">Chile</option>
				    <option value="China">China</option>
				    <option value="Denmark">Denmark</option>
				    <option value="Djibouti">Djibouti</option>
				    <option value="Dominica">Dominica</option>
				    <option value="East Timor">East Timor</option>
				    <option value="Ecuador">Ecuador</option>
				    <option value="Egypt">Egypt</option>
				    <option value="El Salvado">El Salvador</option>
				    <option value="Eritrea">Eritrea</option>
				    <option value="Estonia">Estonia</option>
				    <option value="Kazakhstan">Kazakhstan</option>
				    <option value="Kenya">Kenya</option>
				    <option value="Kiribati">Kiribati</option>
				    <option value="Korea">Korea</option>
				    <option value="Macedonia">Macedonia</option>
				    <option value="Mayotte">Mayotte</option>
				    <option value="Mexico">Mexico</option>
				    <option value="Micronesia">Micronesia</option>
				    <option value="Moldova">Moldova</option>
				    <option value="Monaco">Monaco</option>
				    <option value="Panama">Panama</option>
				    <option value="Paraguay">Paraguay</option>
				    <option value="Peru">Peru</option>
				    <option value="Samoa">Samoa</option>
				    <option value="Sudan">Sudan</option>
				    <option value="Suriname">Suriname</option>
				    <option value="Swaziland">Swaziland</option>
				    <option value="Uganda">Uganda</option>
				    <option value="Ukraine">Ukraine</option>
				    <option value="UNIDO">UNIDO</option>
				    <option value="Venezuela">Venezuela</option>
				    <option selected="selected" value="Vietnam">Vietnam</option>
				    <option value="Yemen">Yemen</option>
				    <option value="Yugoslavia">Yugoslavia</option>
				    <option value="Zambia">Zambia</option>
				    <option value="Zimbabwe">Zimbabwe</option
			    </select>
            </td>
        </tr>
        <tr>
            <td>
                <input type="submit" name="luuthongtin_pl" value=" Thêm" />
                 <input type="reset" name="xoa_pl"  value="Hủy"/>
            </td>            
        </tr>
    </tbody>
</table>
</form>